export default async function loadImageData(url) {

  return new Promise((resolve, reject) => {
      const img = new Image();
      img.onload = () => {
        resolve({
          width:img.width,
          height: img.height,
          img:img
        })
      } ;
      img.onerror = (e) => reject(e);
      // img.crossOrigin = 'anonymous'; 
      img.src =url;
  });
} 